package com.improve.frame.common.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 *      菜单
 * @Author wzxing918
 * @Date 2021-03-31
 * @Version 1.0.0
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_menu")
@ApiModel(description = "菜单")
public class SysMenu extends BaseEntity {
    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称", name = "menuName")
    private String menuName;
    /**
     * 父菜单ID
     */
    @ApiModelProperty(value = "父菜单ID", name = "parentId",example = "0")
    private Long parentId;
    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序", name = "orderNum",example = "0")
    private Integer orderNum;
    /**
     * 菜单URL
     */
    @ApiModelProperty(value = "菜单URL", name = "url",example = "0")
    public String url;
    /**
     * 路由地址
     */
    @ApiModelProperty(value = "路由地址", name = "path")
    private String path;
    /**
     * 组件路径
     */
    @ApiModelProperty(value = "组件路径", name = "component")
    private String component;
    /**
     * 是否为外链（0是 1否）
     */
    @ApiModelProperty(value = "是否为外链（0是 1否）", name = "isFrame",example = "0")
    private Integer isFrame;
    /**
     * 菜单类型（0目录 1菜单 2按钮）
     */
    @ApiModelProperty(value = "菜单类型（0目录 1菜单 2按钮）", name = "menuType")
    private String menuType;
    /**
     * 菜单状态（0显示 1隐藏）
     */
    @ApiModelProperty(value = "菜单状态（0显示 1隐藏）", name = "visible",example = "0")
    private Integer visible;
    /**
     * 权限标识
     */
    @ApiModelProperty(value = "权限标识", name = "perms")
    private String perms;
    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标", name = "icon")
    private String icon;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注", name = "remark")
    private String remark;

    /** 子菜单 */
    @TableField(exist = false)
    private List<SysMenu> children = new ArrayList<>();

    /** 父菜单名称 */
    @TableField(exist = false)
    private String parentName;
}
